package com.dk.shared.autoconfigure.common;

import com.dk.common.exception.DefaultExceptionHandler;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConditionalOnWebApplication
class WebMVCConfiguration {
  @Bean
  @ConditionalOnMissingBean
  @ConditionalOnWebApplication
  public DefaultExceptionHandler defaultExceptionHandler() {
    return new DefaultExceptionHandler();
  }
}
